<!-- 分页组件 -->
<template>
  <div class="pagecom_wrapper">
    <el-pagination
      class="custom-pagination"
      popper-class="select_bottom"
      style="font-size: 14px"
      background
      @current-change="handleCurrentChange"
      @size-change="handleSizeChange"
      :current-page.sync="currentPage1"
      :page-sizes="[10, 30, 50, 100]"
      :page-size="10"
      layout="total, sizes, prev, pager, next, jumper"
      :total="total"
    >
    </el-pagination>
  </div>
</template>

<script>
export default {
  props: {
    total: Number,
    pageSize: Number,
  },
  methods: {
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
      this.$emit("handleSizeChange", val);
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
      this.$emit("handleCurrentChange", val);
    },
  },
  data() {
    return {
      currentPage1: 1,
    };
  },
};
</script>

<style lang="less" scoped>
.pagecom_wrapper {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: auto 50px;
}
/* 自定义选择框的样式 */
.custom-pagination:deep(.el-input .el-input__inner) {
  border: 1px solid #d3dce6;
  height: 28px;
  line-height: 30px;
}

</style>
